﻿<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" ng-click="cancel()">&times;</button>
    <p class="modal-title panel-title-size">人工部署</p>
</div>
<div class="modal-body panel-body">
    <form class="form-horizontal form-validation" name="addHostForm">
        <div class="ren_top_div">
            <span class="ren_top_font">应用通常会依赖MySQL，请先确认已选择模块</span>
        </div>
        <div class="form-group">
            <div class="col-lg-12">
                <label class="col-lg-2 control-label">应用名：</label>
                <div class="col-lg-10 control-input">
                    <input type="text" class="form-control" ng-model="app_name" style="border: 0px;background-color: #fff;" readonly>
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-lg-12">
                <label class="col-lg-2 control-label">镜像版本：</label>
                <div class="col-lg-10 control-input">
                    <select class="form-control" id="selectImg" ng-change="changeImg(img)" ng-model="img">
                        <option value="">--请选择--</option>
                        <option ng-repeat="x in imgs" id="{{x.imageId}}" value="{{x.imageName+':'+x.imageTag}}">{{x.imageName+':'+x.imageTag}}</option>
                    </select>
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-lg-12">
                <label class="col-lg-2 control-label">发布实例：</label>
                <div class="col-lg-10 control-input">
                    <input type="text" name="instanceReplica" class="form-control" ng-model="instanceReplica" validator="required" maxlength="64" maxlength-error-message="最多输入64个字符">
                </div>
            </div>
        </div>
    </form>
    <div class="form-group">
        <div class="col-lg-12">
            <label class="col-lg-2 control-label">高级选项：</label>
            <div style="padding: 6px;">
                <img src="/statics/img/double_down.png" ng-click="showGao($event)">
                <img src="/statics/img/double_up.png" style="display: none;" ng-click="hideGao($event)">
            </div>
        </div>
    </div>
    <div ng-if ="!isadvanced">
        <!--<div class="form-group">
            <label class="col-lg-2 control-label" style="width: 100px;">鍙戝竷绛栫暐锛�</label>
            <div class="radio">
                <label class="i-checks" style="margin-left: 10px;">
                    <input type="radio" name="a" value="option1">
                    <i></i>
                    鑷姩璐熻浇
                </label>
                <label class="i-checks" style="margin-left: 20px;">
                    <input type="radio" name="a" value="option1">
                    <i></i>
                    鎸囧畾涓绘満
                </label>
            </div>
        </div>-->
        <div class="form-group" ng-if="isPei">
            <div class="col-lg-12" style="margin: 10px 0px">
                <label class="col-lg-2 control-label">配置版本：</label>
                <div class="col-lg-10 control-input">
                    <select class="form-control" ng-change="change(buImgType)" ng-model="buImgType">
                        <option ng-repeat="x in busites" value="{{x.value}}">{{x.name}}</option>
                    </select>
                </div>
            </div>
        </div>
        <tabset class="tab-container">
            <tab heading="环境变量">
                <div class="col-sm-12" style="min-height: 123px;margin-bottom: 15px;">
                    <div class="col-sm-12 app-env-border">
                        <p class="app-env-h">添加变量</p>
                        <form class="form-horizontal form-validation" style="display: inline;" name="addEnvForm">
                            <div class="app-env-i" style="width:36%;">
                                <input type="text" ng-model="env.key" class="form-control no-border"  placeholder="key" required>
                            </div>
                            <div class="app-env-i" style="width:36%;">
                                <input type="text" ng-model="env.value" class="form-control no-border" placeholder="value" required>
                            </div>
                        </form>
                        <button class="btn btn-primary w-xs m-r" validation-submit="addEnvForm" ng-disabled="addEnvForm.$invalid" ng-click="addEnv()" style="float: right;"><i class="fa fa-plus-circle"></i>创建</button>
                    </div>
                </div>
                <div class="">
                    <div class="dataTables_wrapper form-inline">
                        <div class="row">
                            <div class="col-sm-12">
                                <div class="col-sm-12" style="max-height: 300px;overflow: auto;">
                                    <div class="col-sm-12 app-env-list">
                                        <p class="app-env-h" style="margin-top: 20px;">管理变量</p>
                                        <table class="table table-striped b-light m-b-xxs">
                                            <thead class="table-header">
                                            <tr>
                                                <th width="40%" class="font-15 ">Key</th>
                                                <th width="40%" class="font-15 ">Value</th>
                                                <th class=" td-operate font-15 text-center" width="20%">操作</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr class="table-content" ng-repeat="row in rowEnvList">
                                                <td width="40%" class="font-15 " title="{{row.configEnvsName}}" ng-bind="row.configEnvsName"></td>
                                                <td width="40%" class="font-15 " title="{{row.configEnvsValue}}" ng-bind="row.configEnvsValue"></td>
                                                <td width="20%" class="td-operate text-center">
                                                    <button class="btn btn-danger btn-sm" ng-click="removeEnv(row)">
                                                        <i class="fa fa-trash-o"></i>
                                                        <span class="">删除</span>
                                                    </button>
                                                </td>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </tab>
            <tab heading="硬盘卷">
                <div class="col-sm-12" style="min-height: 123px;margin-bottom: 15px;">
                    <div class="col-sm-12 app-env-border">
                        <p class="app-env-h">添加卷</p>
                        <form class="form-horizontal form-validation" style="display: inline;" name="addDiskForm">
                            <div class="app-env-i" style="margin-right: 29px;">
                                <input type="text" value="local" class="form-control no-border " readonly>
                            </div>
                            <div class="app-env-i" style="margin-right: 29px;">
                                <input type="text" ng-model="disk.path" class="form-control no-border" placeholder="path"  required>
                            </div>
                        </form>
                        <button class="btn btn-primary w-xs m-r" validation-submit="addDiskForm" ng-disabled="addDiskForm.$invalid" ng-click="addDisk()"><i class="fa fa-plus-circle"></i>创建</button>
                    </div>
                </div>
                <div class="">
                    <div class="dataTables_wrapper form-inline">
                        <div class="row">
                            <div class="col-sm-12">
                                <div class="col-sm-12" style="max-height: 300px;overflow: auto;">
                                    <div class="col-sm-12 app-env-list">
                                        <p class="app-env-h" style="margin-top: 20px;">管理卷</p>
                                        <table class="table table-striped b-light m-b-xxs">
                                            <thead class="table-header">
                                            <tr>
                                                <th width="30%" class="font-15 ">Type</th>
                                                <th width="30%" class="font-15 ">Path</th>
                                                <th class=" td-operate font-15 text-center" width="10%">操作</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr class="table-content" ng-repeat="row in rowDiskList">
                                                <td width="30%" class="font-15 ">local</td>
                                                <td width="30%" class="font-15 " title="{{row.configVolumesPath}}" ng-bind="row.configVolumesPath"></td>
                                                <td width="10%" class="td-operate text-center">
                                                    <button class="btn btn-danger btn-sm" ng-click="removeDisk(row)">
                                                        <i class="fa fa-trash-o"></i>
                                                        <span class="">删除</span>
                                                    </button>
                                                </td>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </tab>
            <tab heading="端口">
                <div class="col-sm-12" style="min-height: 123px;margin-bottom: 15px;">
                    <div class="col-sm-12 app-env-border">
                        <p class="app-env-h">添加端口</p>
                        <form class="form-horizontal form-validation" style="display: inline;" name="addPortForm">
                            <div class="app-env-i" style="width:72%;">
                                <input type="text" ng-model="port.value" class="form-control no-border" value="8080"  required>
                            </div>
                        </form>
                        <button class="btn btn-primary w-xs m-r" validation-submit="addPortForm" ng-disabled="addPortForm.$invalid" ng-click="addPort()" style="float: right;"><i class="fa fa-plus-circle"></i>创建</button>
                    </div>
                </div>
                <div class="">
                    <div class="dataTables_wrapper form-inline">
                        <div class="row">
                            <div class="col-sm-12">
                                <div class="col-sm-12" style="max-height: 300px;overflow: auto;">
                                    <div class="col-sm-12 app-env-list">
                                        <p class="app-env-h" style="margin-top: 20px;">管理端口</p>
                                        <table class="table table-striped b-light m-b-xxs">
                                            <thead class="table-header">
                                            <tr>
                                                <th width="60%" class="font-15 ">Value</th>
                                                <th class=" td-operate font-15 text-center" width="40%">操作</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr class="table-content" ng-repeat="row in rowPortList">
                                                <td width="60%" class="font-15 " title="{{row.configPortsPort}}" ng-bind="row.configPortsPort"></td>
                                                <td width="40%" class="td-operate text-center">
                                                    <button class="btn btn-danger btn-sm" ng-click="removePort(row)">
                                                        <i class="fa fa-trash-o"></i>
                                                        <span class="">删除</span>
                                                    </button>
                                                </td>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </tab>
            <tab heading="资源配置">
                <form class="form-horizontal form-validation" name="addShenForm">
                    <div style="margin-top: 20px;">
                        <label class="col-lg-2 control-label" style="width: 120px;">cpu</label>
                        <input type="text" class="form-control shen_font" ng-model="paramConfig.cpu">
                    </div>
                    <div style="margin-top: 20px;">
                        <label class="col-lg-2 control-label" style="width: 120px;">内存</label>
                        <input type="text" class="form-control shen_font" ng-model="paramConfig.mem">Mi
                    </div>
                </form>
            </tab>
            <!--<tab heading="寮规�т几缂�">
                <form class="form-horizontal form-validation" name="addShenForm">
                    <div style="margin-top: 20px;">
                        <label class="col-lg-2 control-label" style="width: 120px;">绛栫暐鍚嶇О</label>
                        <input type="text" class="form-control shen_font" name="">
                    </div>
                    <div style="margin-top: 20px;">
                        <label class="col-lg-2 control-label" style="width: 120px;">鏈�澶ц妭鐐�</label>
                        <input type="text" class="form-control shen_font" name="">
                    </div>
                    <div style="margin-top: 20px;">
                        <label class="col-lg-2 control-label" style="width: 120px;">鏈�灏忚妭鐐�</label>
                        <input type="text" class="form-control shen_font" name="">
                    </div>
                    <div style="margin-top: 20px;">
                        <label class="col-lg-2 control-label" style="width: 120px;">闆嗙兢璧勬簮鍗犳瘮</label>
                        <input type="text" class="form-control shen_font" name="">
                    </div>
                    <div style="margin-top: 20px;">
                        <label class="col-lg-2 control-label" style="width: 120px;">CPU&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;鎵╁睍闃堝��</label>
                        <input type="text" class="form-control shen_font" name="">%
                    </div>
                    <div style="margin-top: 20px;">
                        <label class="col-lg-2 control-label" style="width: 120px;">鍐呭瓨&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;鎵╁睍闃堝��</label>
                        <input type="text" class="form-control shen_font" name="">MB
                    </div>
                    <div style="margin-top: 20px;">
                        <label class="col-lg-2 control-label" style="width: 120px;">缃戠粶&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;鎵╁睍闃堝��</label>
                        <input type="text" class="form-control shen_font" name="">KM/S
                    </div>
                </form>
            </tab>-->
        </tabset>
    </div>
</div>
<div class="modal-footer">
    <button type="submit" class="btn btn-primary" validation-submit="addHostForm" ng-disabled="addHostForm.$invalid" ng-click="ok()">确认</button>
    <button class="btn btn-default" ng-click="cancel()">取消</button>
</div>